import request from "@/router/axios";

export const getList = (current, size, params) => {
  return request({
    url: "/api/hg-quality/proassign/page",
    method: "get",
    params: {
      ...params,
      current,
      size
    }
  });
};

export const add = row => {
  return request({
    url: "/api/hg-quality/proassign/save",
    method: "post",
    data: row
  });
};

export const assignBatch = params => {
  return request({
    url: "/api/hg-quality/proassign/assignBatch",
    method: "post",
    params: {
      ...params
    }
  });
};

export const update = row => {
  return request({
    url: "/api/hg-quality/proassign/update",
    method: "post",
    data: row
  });
};

export const getDetail = id => {
  return request({
    url: "/api/hg-quality/proassign/detail",
    method: "get",
    params: {
      id
    }
  });
};

export const remove = ids => {
  return request({
    url: "/api/hg-quality/proassign/remove",
    method: "post",
    params: {
      ids
    }
  });
};
// 获取部门
export const getDept = () => {
  return request({
    url: "/api/blade-system/dept/tree",
    method: "get"
  });
};
// 获取责任人
export const getUsers = deptId => {
  return request({
    url: "api/blade-system/personnelinfo/getUsers",
    method: "get",
    params: {
      deptId
    }
  });
};
// 质量问题批量分配统计
export const getStatistics = () => {
  return request({
    url: "api/hg-quality/proassign/statistics",
    method: "get"
  });
};
